/*----------------------------------------------------------------------------------------
*
*  Copyright 2019, Gao Hai Hui, <fromzeropoint@126.com>.  All rights reserved.
*  https://gitee.com/helloworldghh/xoskit.git
*  Use of this source code is governed by a MIT license
*  that can be found in the License file.
*
----------------------------------------------------------------------------------------*/
#ifndef __5C6EBD03_6017_4589_92C2_969A18A05A38__
#define __5C6EBD03_6017_4589_92C2_969A18A05A38__


/////////////////////////////////////////////////////////////////////////////////////////
// 
namespace xos_box
{

    // 
    // buf interface
    // 
    class i_msg : public xos::i_release
    {
    public:
        // 
        // extend param for int, double, void *, char * num.
        // 
        enum enumExtraParamNum
        {
            EXTRA_PARAM_NUM = 20
        };

    protected:
        virtual ~i_msg(){}

    public:
        //////////////////////////////////////////////////////////////////////////////////////
        // 
        // data member
        //

        // 
        // string
        // 
        virtual const char * get_str( int nIndex, char * lpszStr, int nSize, int * lpnLenNeeded ) = 0;
        virtual int set_str( int nIndex, const char * lpszStr ) = 0;

        // 
        // xos_box::i_big_buf
        // 
        virtual xos_box::i_big_buf * get_big_buf( int nIndex, xos_box::i_big_buf ** lppBigBuf ) = 0;
        virtual int set_big_buf( int nIndex, xos_box::i_big_buf * lpBigBuf ) = 0;

        // 
        // xos_box::i_buf
        // 
        virtual xos_box::i_buf * get_buf( int nIndex, xos_box::i_buf ** lppBuf ) = 0;
        virtual int set_buf( int nIndex, xos_box::i_buf * lpBuf ) = 0;

        // 
        // double
        // 
        virtual double get_double( int nIndex, double * lpdlData ) = 0;
        virtual int set_double( int nIndex, double dlData ) = 0;

        // 
        // void *
        // 
        virtual void * get_void( int nIndex, void ** lppData ) = 0;
        virtual int set_void( int nIndex, void * lpData ) = 0;

        // 
        // int64_t
        // 
        virtual int64_t get_i64( int nIndex, int64_t * lpi64 ) = 0;
        virtual int set_i64( int nIndex, int64_t i64 ) = 0;

        // 
        // int
        // 
        virtual int get_int( int nIndex, int * lpnInt ) = 0;
        virtual int set_int( int nIndex, int nInt ) = 0;

        // 
        // bool
        // 
        virtual bool get_bool( int nIndex, bool * lpBool ) = 0;
        virtual int set_bool( int nIndex, bool bBool ) = 0;

        // 
        // runnable
        // 
        virtual xos::f_runnable get_runnable( int nIndex, xos::f_runnable * lpRun ) = 0;
        virtual int set_runnable( int nIndex, xos::f_runnable lpRun ) = 0;

        // 
        // msg
        // 
        virtual int get_msg( int nIndex, int* lpnInt ) = 0;
        virtual int set_msg( int nIndex, int nInt ) = 0;

        // 
        // 因为太经常用了，所以加两对方法支持一下
        // 
        virtual int set_msg_type( int nType ) = 0;
        virtual int set_msg( int nMsg ) = 0;
        virtual int get_msg_type() = 0;
        virtual int get_msg() = 0;
    };
}

#endif // __5C6EBD03_6017_4589_92C2_969A18A05A38__
